#include <stdio.h>  
char map[1005][1005];  
int main(void) {  
    int n;  
    char c;  
    scanf("%d %c", &n, &c);  
  
    c = c >= 'A' && c <= 'Z' ? c : c + 'A' - 'a';  
    if (n % 2 == 0 || (c < 'A' || c > 'Z')) {  
        printf("input error!\n");  
        return 0;  
    }  
    for (int i = 0; i < n; i++) {  
        map[0][i] = c;  
        c++;  
        if (c > 'Z')  
            c = 'A';  
        if (i == n / 2 || i == 0 || i == n - 1) {  
            char c2 = c;  
            for (int j = 1; j < n; j++) {  
                map[j][i] = c2;  
                c2++;  
                if (c2 > 'Z')  
                    c2 = 'A';  
            }  
        } else {  
            for (int j = 1; j < n; j++) {  
                map[j][i] = ' ';  
  
            }  
            int c2 = map[n - 1][i - 1] + 1;  
            if (c2 > 'Z')  
                c2 = 'A';  
            map[n - 1][i] = c2;  
        }  
  
    }  
    for (int i = 0; i < n; i++) {  
        for (int j = 0; j < n; j++)  
            printf("%c", map[i][j]);  
        printf("\n");  
    }  
    return 0;  
}  